window.addEventListener('load', function() {
    var tit = document.querySelectorAll(".four-list")
    var p = document.querySelectorAll(".five-list")
    for (var i = 0; i < tit.length; i++) {
        tit[i].dataset.num1 = i
        tit[i].onmousemove = function() {
            // p[this.dataset.num1].classList.remove("hide")
            this.classList.add('add-four')
        }
        tit[i].onmouseout = function() {
            // p[this.dataset.num1].classList.add("hide")
            this.classList.remove('add-four')

        }
    }
    var tit1 = document.querySelectorAll(".tab-item")
    var p1 = document.querySelectorAll(".eight-key")
    for (var i = 0; i < tit1.length; i++) {
        tit1[i].dataset.index = i
        tit1[i].onclick = function() {
            for (var j = 0; j < tit1.length; j++) {
                p1[j].style.display = 'none'
                tit1[j].classList.remove('item')
            }
            p1[this.dataset.index].style.display = 'block'
            this.classList.add('item')
        }
    }
    var b = document.querySelector('.right-nav')
    window.onscroll = function() {
        if (document.documentElement.scrollTop >= 655) {
            b.style = "display:block"

        } else {
            b.style = "display:none"

        }
        b.onclick = function() {
            document.documentElement.scrollTop = 0
        }
    }
    var list = document.querySelector('.allshop')
    var ol = document.querySelector('.four-all')
    console.log(list)

    list.onmousemove = function() {
        ol.style = "display:block"
    }
    list.onmouseout = function() {
        ol.style = "display:none"
    }
    ol.onmousemove = function() {
        ol.style = "display:block"
    }
    ol.onmouseout = function() {
        ol.style = "display:none"
    }
    var zc = document.querySelector('.zc')
    zc.onclick = () => {
        window.location.href = "login2.html"
    }
    var photo = document.querySelector('.photo1')
    console.log(photo)
    photo.onclick = function() {
        window.location.href = "frist-page.html";
    }
})